﻿using mozhi.smarterp.BasicData.Products;
using mozhi.smarterp.BasicData.Products.Repositories;
using Mozhi.Abp.Core.Networks;
using Mozhi.Abp.Infrastructure.RemoteRepositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mozhi.smarterp.BasicData.RemoteRepositories
{
    public class ProductInventorySettingRepository : RemoteRepository<ProductInventorySetting>, IProductInventorySettingRepository
    {
        public ProductInventorySettingRepository(IRemoteServiceClient remoteServiceClient) : base(remoteServiceClient, "Business", "api/v1/products/inventory-settings")
        {
        }

        public async Task DeleteAsync(Guid productId)
        {
            var url = _url + productId;

            await _remoteServiceClient.DeleteAsync(_serviceName, url);
        }

        public async Task<int> GetCountAsync(Guid productId)
        {
            var url = _url + productId;

            var count = await _remoteServiceClient.GetAsync<int>(_serviceName, url);

            return count;
        }
    }
}
